package com.neusoft.elmboot.controller;

import com.neusoft.elmboot.po.Comment;
import com.neusoft.elmboot.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/CommentController")
public class CommentController {

    @Autowired
    private CommentService commentService;

    @RequestMapping("/listCommentByBusinessId")
    public List<Comment> listCommentByBusinessId(Comment comment) throws Exception{
        return commentService.listCommentByBusinessId(comment);
    }

    @RequestMapping("/saveComment")
    public int saveComment(Comment comment) throws Exception {
        return commentService.saveComment(comment);
    }

    @RequestMapping("/updateComment")
    public int updateComment(Comment comment) throws Exception {
        return commentService.updateComment(comment);
    }

    @RequestMapping("/removeComment")
    public int removeComment(Comment comment) throws Exception {
        return commentService.removeComment(comment);
    }
}
